From: kaf24@firebug.cl.cam.ac.uk Date: Sun, 30 Apr 2006 08:39:04 +0000 (+0100) Subject: Fix blktap "bad page state" bug. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~16108^2~45 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=88ebde157080fbe228462f654cec81e2c1f63708;p=xen.git Fix blktap "bad page state" bug. Signed-off-by: Andrew Warfield Signed-off-by: Ewan Mellor --- diff --git a/linux-2.6-xen-sparse/mm/memory.c b/linux-2.6-xen-sparse/mm/memory.c index 3482a6bcf7..29c9095487 100644 --- a/linux-2.6-xen-sparse/mm/memory.c +++ b/linux-2.6-xen-sparse/mm/memory.c @@ -968,6 +968,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, { int i; unsigned int vm_flags; + int xenpage = 0; /* * Require read or write permissions. @@ -1025,10 +1026,14 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, if (vma && (vma->vm_flags & VM_FOREIGN)) { struct page **map = vma->vm_private_data; int offset = (start - vma->vm_start) >> PAGE_SHIFT; - + xenpage =1; if (map[offset] != NULL) { - if (pages) - pages[i] = map[offset]; + if (pages) { + struct page *page = map[offset]; + + pages[i] = page; + get_page(page); + } if (vmas) vmas[i] = vma; i++;